/*
 *  Finitestatemachine.cpp
 *
 *  Created on: 08.10.2010
 *      Author: Andreas Rapp
 */
#ifndef FINITESTATEMACHINE_H_
#define FINITESTATEMACHINE_H_
#include "Buffer.h"
#include "Token.h"

class FiniteStateMachine {
private:
	int line;
	int colum;
	Buffer* buffer;
	Token* latestToken;
	char latestChar;
	enum currentType { INTEGER, IDENTIFIER, SIGN};
	char getNextChar();
	void jumpBack();
	Token* readOpeningBracket();
	Token* readInt();
	Token* readIdentifier();
	char jumpWhitespace();
public:
	FiniteStateMachine(Buffer* buffer);
	Token* nextToken();
	bool isNumber(char testChar);
	bool isLetter(char testChar);
	bool isSighn(char testChar);

};
#endif /* FINITESTATEMACHINE_H_ */
